<template>
	<view class="container">
		<view class="detail-card">
			<!-- 上报信息展示 -->
			<view class="detail-item">
				<text class="detail-label">上报员工：</text>
				<text class="detail-value">{{ detailData.employeeName }}</text>
			</view>

			<view class="detail-item">
				<text class="detail-label">上报日期：</text>
				<text class="detail-value">{{ detailData.reportDate }}</text>
			</view>

			<view class="detail-item">
				<text class="detail-label">上报金额：</text>
				<text class="detail-value">￥{{ detailData.reportedAmount }}</text>
			</view>

			<!-- 审核信息展示 -->
			<view class="detail-item">
				<text class="detail-label">实际金额：</text>
				<text class="detail-value">￥{{ detailData.actualAmount }}</text>
			</view>

			<view class="detail-item">
				<text class="detail-label">审核状态：</text>
				<text :class="['status-tag', detailData.auditStatus === 'APPROVED' ? 'success' : 'error']">
					{{ statusMap[detailData.auditStatus] }}
				</text>
			</view>

			<view class="detail-item">
				<text class="detail-label">差额：</text>
				<text :style="{ color: detailData.difference < 0 ? '#dd524d' : '#4cd964' }">
					￥{{ detailData.difference }}
				</text>
			</view>

			<view class="detail-item full-width">
				<text class="detail-label">审核备注：</text>
				<text class="detail-value">{{ detailData.auditNotes || '无备注信息' }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import { getReports } from "@/api/system/cash/reports"

	export default {
		data() {
			return {
				detailData: {},
				statusMap: {
					'APPROVED': '审核通过',
					'REJECTED': '审核驳回',
					'PENDING': '待审核',
					'REVOKE': '撤回',
				}
			}
		},
		onLoad(options) {
			getReports(options.id).then(response => {
				console.log(response)
				this.detailData = response.data
			})
		},
		methods: {
		}
	}
</script>

<style scoped>
	.container {
		padding: 20rpx;
		background-color: #f5f5f5;
		min-height: 100vh;
	}

	.detail-card {
		background: #fff;
		padding: 30rpx;
		border-radius: 16rpx;
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	}

	.detail-item {
		display: flex;
		align-items: center;
		margin-bottom: 30rpx;
		font-size: 28rpx;
	}

	.detail-label {
		width: 160rpx;
		color: #666;
	}

	.detail-value {
		flex: 1;
		color: #333;
	}

	.full-width {
		align-items: flex-start;
	}

	.status-tag {
		padding: 8rpx 20rpx;
		border-radius: 8rpx;
		font-size: 24rpx;
	}

	.success {
		background-color: #e8f5e9;
		color: #4caf50;
	}

	.error {
		background-color: #ffebee;
		color: #f44336;
	}
</style>